package com.neuedu.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neuedu.dao.ClientDao;

import com.neuedu.model.Client;
import com.neuedu.service.ClientService;

//配置一个spring的服务，把业务实现类交给spring进行管理，由spring完成依赖注入
@Service
public class ClientServiceImpl implements ClientService {

	//织入-依赖注入
		@Autowired
		private ClientDao ClientDao;	
	public void setClientDao(ClientDao clientDao) {
			this.ClientDao = clientDao;
		}

	@Override
	public int countClient() {
		
		return ClientDao.countClient();
	}

	@Override
	public List<Client> findAll(Map<String, Object> map) {
		
		return ClientDao.findAll(map);
	}

	@Override
	public int addClient(Client c) {
		return ClientDao.addClient(c);
	}

	@Override
	public int updateClient(Client c) {
		return ClientDao.updateClient(c);
	}

	@Override
	public int deleteClient(int id) {
		return ClientDao.deleteClient(id);
	}

}
